package models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import play.db.ebean.Model;

@Entity
@Table(name = "perfis_itens")
public class ItensPerfis extends Model {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	@Column(name = "peit_id")
	private Integer id;
	
	@Column(name = "peit_nome", nullable = false, length = 200)
	private String nome;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "peit_perf_id", nullable = false)
	private Perfis perfis;

	public ItensPerfis() {
		super();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public Perfis getPerfis() {
		return perfis;
	}

	public void setPerfis(Perfis perfis) {
		this.perfis = perfis;
	}
	
	public static Model.Finder<Integer, ItensPerfis> find = new Finder<Integer, ItensPerfis>(Integer.class, ItensPerfis.class);
	

}
